package org.allen.mst4j.service.impl;

import java.util.List;

import org.allen.mst4j.common.Constants;
import org.allen.mst4j.dao.OriginalMachineMapper;
import org.allen.mst4j.dao.SkillNatureMapper;
import org.allen.mst4j.domain.SkillNature;
import org.allen.mst4j.service.OriginalMachineService;
import org.allen.mst4j.sysBean.PagerBean;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

@Service
@Transactional(readOnly = false,propagation = Propagation.REQUIRED,timeout = Constants.DB_TIMEOUT)
public class OriginalMachineServiceImpl extends BaseServiceImpl implements OriginalMachineService{

	@Autowired
	protected OriginalMachineMapper mapper;
	
	@Autowired
	protected SkillNatureMapper skillNatureMapper;
	
	@Transactional(readOnly = true)
	public PagerBean<SkillNature> selectSkillNature() {
		List<SkillNature> list = skillNatureMapper.select(new SkillNature());
		SkillNature empty = new SkillNature();
		empty.setId(0l);
		empty.setName("无");
		list.add(0,empty);
		
		PagerBean<SkillNature> bean = new PagerBean<SkillNature>();
		bean.setRows(list);
		return bean;
	}
}
